from protocol.template import Template, Block
from protocol.fields import *


tmpl = Template(1,"CompleteAgentMovement","Low",True,"Unencoded") # TODO: make Unencoded a constant or just a BOOL

agentdata = Block("AgentData")

agent_uuid = "35353fa3-8303-4d1b-aa08-f54416c8c921"
session_uuid = "35353fa3-8303-4d1b-aa08-f54416c8c921"
agentdata.append(LLUUIDField("AgentID"))
agentdata.append(LLUUIDField("SessionID"))
agentdata.append(U32Field("CircuitCode"))
tmpl.append(agentdata)

from protocol.message import Message
msg = Message(tmpl)
msg.AgentData.AgentID.value=agent_uuid
msg.AgentData.SessionID.value=session_uuid
msg.AgentData.CircuitCode.value=56212

from protocol.packet import Packet
packet = Packet(tmpl,msg,seq=1)

from helpers import hexprint, printUDP
printUDP(packet.toBytes())
